package com.usooft.metaTalent.db.platform;

import com.usooft.framework.core.query.Page;
import com.usooft.framework.web.auth.RequiresPermission;
import com.usooft.metaTalent.core.platform.service.VideoService;
import com.usooft.metaTalent.core.platform.wrapper.VideoWrapper;
import com.usooft.metaTalent.db.platform.form.VideoListForm;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/platform/video")
@RequiredArgsConstructor
public class VideoController {
    private final VideoService videoService;

    @GetMapping("/list")
    @RequiresPermission(
            value = "/platform/video/list",
            description = "视频/查询"
    )
    public ResponseEntity<?> list(VideoListForm form) {
        Page<VideoWrapper> page = videoService.page(form.buildQuery());
        return ResponseEntity.ok(page);
    }
}
